-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Github Action tip to README #368
Conversation
The tip should lay out how to correctly configure a step to deploy an application via Github Actions. See issue #345 for more details
Thanks @mickelsonmichael it works well |
# REPLACE "tschaub/gh-pages" IN THE GIT URL BELOW WITH YOUR REPOSITORY'S INFORMATION | ||
- name: Deploy with gh-pages | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the instruction to replace the repository name in the git url is actually not necessary if you use the GITHUB_REPOSITORY
environment variable 😉
https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Deploy with gh-pages | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git | ||
npx gh-pages -d build -u "github-actions-bot <[email protected]>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came across gh-pages via the example in the create-react-app docs: https://create-react-app.dev/docs/deployment/#step-2-install-gh-pages-and-add-deploy-to-scripts-in-packagejson
If gh-pages is executed via a named script, the command needs to be modified slightly (note the --
to pass the additional argument to the wrapped gh-pages call). Maybe this should be included as another example.
"scripts": {
"deploy": "gh-pages -d build"
}
npm run deploy -- -u "github-actions-bot <[email protected]>"
@phibo23 sorry for the enormous delay on getting back to you on this. I'd like to implement those changes, but it looks like I must have carelessly deleted my fork already and can't figure out how to add the changes. Will I have to merge then create a second PR or is there a way to edit still? |
@phibo23 was able to get the gh-cli to open the PR, but wasn't able to properly associate the commits with the PR. I have recreated and updated a new fork with the changes you requested, but it may require a new PR altogether, since I don't seem to be able to update this Pull Request |
See #378 for the fixed PR |
After having spent a few hours attempting to configure the
gh-pages
cli to perform on Github's Actions, including using a third-party plugin, a lot of time could have been saved by simply having this tip readily accessible.